<template>
  <div class="con">
    <div class="echarts" id="electric9Echarts"></div>
  </div>
</template>

<script>
export default {
  name: "electricBoxArea9",
  props: ["idInfo"],
  data() {
    return {
      option: {
        color: ["#80FFA5", "#00DDFF", "#37A2FF"],
        title: {
          //   text: "问题趋势",
          //   textStyle: {
          //     color: "#ccc",
          //   },
        },
        tooltip: {
          trigger: "axis",
          axisPointer: {
            type: "cross",
            label: {
              backgroundColor: "#6a7985",
            },
          },
        },
        legend: {
          // show:false,
          data: ["Line 1", "Line 2", "Line 3"],
          // itemHeight: 20,
          // itemWidth: 20,
          top: "10px",
          icon: "circle",
          textStyle: {
            color: "#ccc",
            fontSize:14,
          },
        },
        grid: {
          left: "3%",
          right: "4%",
          bottom: "3%",
          containLabel: true,
        },
        xAxis: [
          {
            type: "category",
            boundaryGap: false,
            data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
          },
        ],
        yAxis: [
          {
            type: "value",
          },
        ],
        series: [
          {
            name: "Line 1",
            type: "line",
            stack: "Total",
            smooth: true,
            lineStyle: {
              width: 0,
            },
            showSymbol: false,
            areaStyle: {
              opacity: 0.8,
              colorStops: [
                {
                  offset: 0,
                  color: "yellowgreen", // 0% 处的颜色
                },
                {
                  offset: 1,
                  color: "hotpink", // 100% 处的颜色
                },
              ],
            },
            emphasis: {
              focus: "series",
            },
            data: [14, 23, 10, 26, 9, 34, 25],
          },
          {
            name: "Line 2",
            type: "line",
            stack: "Total",
            smooth: true,
            lineStyle: {
              width: 0,
            },
            showSymbol: false,
            areaStyle: {
              opacity: 0.8,
              colorStops: [
                {
                  offset: 0,
                  color: "rgb(0, 221, 255)", // 0% 处的颜色
                },
                {
                  offset: 1,
                  color: "rgb(77, 119, 255)", // 100% 处的颜色
                },
              ],
            },
            emphasis: {
              focus: "series",
            },
            data: [12, 28, 11, 23, 22, 34, 31],
          },
        ],
      },
    };
  },
  methods: {},
  mounted() {
    setTimeout(() => {
      const myCharts = this.$echarts.init(
        document.getElementById("electric9Echarts")
      );
      myCharts.setOption(this.option);
    }, 500);
  },
};
</script>

<style lang="scss" scoped>  
.con {
  .echarts {
    width: 415px;
    height: 240px;
  }
}
</style>